package org.example.autosuggest;

import java.util.Collection;

public class SuggestWithDemo {
    public static void main(String[] args) {
        LexerAndParserFactory lexerAndParserfactory = new ReflectionLexerAndParserFactory(
                com.neuronbit.parser.DemoLexer.class, com.neuronbit.parser.DemoParser.class);
        Collection<SuggestionItem> suggestions = new AutoSuggester(lexerAndParserfactory, "coun")
                .suggestCompletions();
        if (null != suggestions && suggestions.size()>0) {
            for (SuggestionItem suggestion : suggestions) {
                System.out.println(suggestion);
            }
        } else {
            System.out.println("suggestion is empty");
        }
    }
}
